import { createWebHashHistory, createRouter } from 'vue-router';
import { createRouterGuard } from '@/router/guard/index.js';
import { LoginRoute, RootRoute, PathMatchRoute, notFont } from './routes';
const constantRoutes = [LoginRoute, RootRoute, PathMatchRoute, notFont];
const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes,
  scrollBehavior: () => ({ left: 0, top: 0 })
});

export async function setupRouter(app) {
  app.use(router);
  createRouterGuard(router);
  await router.isReady();
}

export default router;
